Closed Bug 611307 Opened 14 years ago Closed 14 years ago

Cannot install a Style when clicking on the 'Install with Stylish' button at given URL.

Categories

(Core :: XPConnect, defect)

defect
Not set
major

Tracking

()

RESOLVED INVALID
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: streetwolf52, Unassigned)

References

()

Details

(Keywords: regression)

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101110 Firefox/4.0b8pre
Build Identifier: 20101110171228

Clicking on the 'Install with Stylish' button at the given URL does not bring up the Add-On Stylish.

Reproducible: Always

Steps to Reproduce:
1. Install Stylish https://addons.mozilla.org/en-US/firefox/addon/2108/
2. Go to the given URL and choose any style to install.
3. Press the 'Install with Stylish' button
Actual Results:  
Nothing happens

Expected Results:  
Stylish edit window should pop up. 

Caused by http://hg.mozilla.org/mozilla-central/rev/43e0c9f82545
Keywords: regression
Version: unspecified → Trunk
Priority: -- → P1
Priority: P1 → --
blocking2.0: --- → ?
Could also be this https://bugzilla.mozilla.org/show_bug.cgi?id=605760 since this patch was included in cset 43e0c9f82545
Could also be this https://bugzilla.mozilla.org/show_bug.cgi?id=605760 since this patch was included in cset 43e0c9f82545
Assignee: general → nobody
Component: JavaScript Engine → XPConnect
OS: Windows 7 → All
QA Contact: general → xpconnect
Hardware: x86_64 → All
Blocks: 571849
Status: UNCONFIRMED → NEW
Ever confirmed: true
blocking2.0: ? → betaN+
FYI
This problem is very similar to Bug 604476.

If I modified  Stylish-1.0.11.xpi\content\overlay.js as follows, the problem was fone.

 installFromSite: function(event) {

* snip *

-    for (i in links) {
+    for (let i = 0; i < links.length; i++) {
        switch (links[i].rel) {
s/fone/gone/
I want to call this the result of a bug fix. The JS construct for (i in obj) {} iterates over the prototype chain, resulting in iterating the XPConnect functions and properties on the prototype chain (in this case: length, item, and namedItem). bug 604476 fixed XrayWrapper so that we properly do this now. IMO the for loop from 0 to length is safer and the right "fix" for this bug. Alternatively, you could use the Iterator() constructor trick as was used in bug 604476.

For additional fun, try this in a content document and you'll see that XrayWrappers now more closely map to the behavior of the underlying object.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Blake, just checking: JS core class prototypes never have enumerable properties. Are we making proto-props enumerable where we should not (i.e., where other DOM implementations do not)?

/be
(In reply to comment #6)
> Blake, just checking: JS core class prototypes never have enumerable
> properties. Are we making proto-props enumerable where we should not (i.e.,
> where other DOM implementations do not)?

Brendan, XPConnect/DOM properties have always been enumerable. At the very least, both Safari and Chrome agree with us here.
Thanks -- not great but we are stuck with enumerable proto-props. Consistency, what's that?

/be
You need to log in before you can comment on or make changes to this bug.